import { BaseApi } from "@/api-services/apis/baseApi";
import { SysUser } from "@/api-services/models/system/user";
import { BaseIdInput } from "@/api-services/models/baseModels";
import { SysMenu } from "@/api-services/models/system";

/**
 * 用户管理Api
 */
class UserPersonalApi extends BaseApi<SysUser.SysUser, SysUser.UserAddInput, SysUser.UserUpdateInput> {
  errorFileDownload = async (data: BaseIdInput) => {
    return this.normalGetBlob(`/errorDownload`, data);
  };
  //修改密码
  changePassword = async (data: SysUser.ChangePwdInput) => {
    return this.normalPost(`/changePassword`, data);
  };

  //获取登录用户信息
  loginUserDetail = async () => {
    return this.normalGet<SysUser.SysUserInfo>(`/loginUserDetail`, null);
  };
  getLoginUserMenuAndButton = async () => {
    return this.normalGet<SysMenu.MeunAndButtonList>(`/getLoginUserMenuAndButton`, null);
  };
}

export default new UserPersonalApi("/system/userPersonal");
